package chinawxd765.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class IndexController {

	@GetMapping(value = "/")
    public ModelAndView index() {
    	
		ModelAndView mv = new ModelAndView("index");
		return mv;
    }
	
	@GetMapping(value = "/home")
    public String home(Model map) {
    	
		map.addAttribute("host", "This is home page By get!");
		return "home";
    }
	
	@GetMapping(value = "/login")
    public ModelAndView login(HttpServletRequest request, HttpServletResponse response) {
    	
		ModelAndView mv = new ModelAndView("login");
		return mv;
    }

}